#include <cstdio>
#include <vector>
#include <cstring>

using namespace std;

bool visit[ 1000001 ];
int cnt, n, m, d[ 1000001 ], pcnt;
vector<int> li[ 1000001 ];

void init( )
{
    int i, u, v;
    memset( d, 0, sizeof( d ) );
    memset( visit, 0, sizeof( visit ) );
    for ( i = 0; i < n; i++ )
        li[ i ].clear( );
    for ( i = 0; i < m; i++ )
    {
        scanf("%d%d", &u, &v); u--; v--;
        li[ u ].push_back( v );
        li[ v ].push_back( u );
        d[ u ]++; d[ v ]++;
    }
}

void dfs( int p )
{
    int i;
    pcnt++;
    cnt += d[ p ] & 1;
    for ( i = 0; i < li[ p ].size(  ); i++ )
        if ( !visit[ li[ p ][ i ] ] )
        {
            visit[ li[ p ][ i ] ] = true;
            dfs( li[ p ][ i ] );
        }
}

void work( )
{
    int i, ans = 0;
    for ( i = 0; i < n; i++ )
        if ( !visit[ i ] )
        {
            pcnt = 0;
            visit[ i ] = true;
            cnt = 0;
            dfs( i );
            if ( pcnt == 1 ) continue;
            if ( cnt == 0 ) ans++;
            ans += cnt / 2;
        }
    printf("%d\n", ans);
}

int main( )
{
    while ( scanf("%d%d", &n, &m) != EOF )
    {
        init( );
        work( );
    }
    return 0;
}
